// session验证

const isEmptyObj = require('../util/is_empty_object')
 
module.exports = async function (ctx, next){

    const session = await ctx.session 
    
    if(ctx.url.search(/sign/ig) === -1 && isEmptyObj(session)){
        
        ctx.body = {
            status: 400,
            msg: '未登录'
        }
        
        return
    }

    await next()

}

